package com.example.administrator.managesystem.adapter.holder;

import android.content.Context;
import android.support.v7.widget.CardView;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.administrator.managesystem.R;
import com.example.administrator.managesystem.base.BaseHolder;
import com.example.administrator.managesystem.bean.CameraListBean;
import com.example.administrator.managesystem.bean.WikiListBean;
import com.squareup.picasso.Picasso;

public class CameraHolder extends BaseHolder<CameraListBean.DataBean> {
    private TextView device_number;

    private Context context;
    private OnItemClickListener listener;
    public interface OnItemClickListener {
        void onItemClick(int position,String device_number, View v);
    }
    public CameraHolder(View view, Context context, OnItemClickListener listener) {
        super(view);
        this.context=context;
        this.listener=listener;
    }

    @Override
    public void initView(View view) {
        device_number = view.findViewById(R.id.device_number);

    }

    @Override
    public void bindViewHolder(final CameraListBean.DataBean dataBean, final int position) {
        device_number.setText(dataBean.getDevice_number());

        device_number.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                listener.onItemClick(position,dataBean.getDevice_number(),v);
            }
        });
    }



}
